package de.pmg_grandma;

import model.Model;
import model.WishFactory;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;

public class GenerateWishesActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		//Markiere, dass App den Fokus hat
		Model.getInstance().inAppFocus = true;
		setContentView(R.layout.activity_generate);
	}

	public void onButtonClick(View view){

		//Je nachdem, welcher Knopf gedrückt wurde --> Generiee jeweilligen Wunsch
		switch(view.getId()) {
		case R.id.essensWunsch: 
			WishFactory.createWishToEat(); break;

		case R.id.schlafenWunsch: 
			WishFactory.createWishToSleep(Model.SCHLAFEN_KURZ); break;

		case R.id.putzenWunsch:
			WishFactory.createWishToCleanApartment(); break;

		case R.id.waschWunsch:
			WishFactory.createWishToWashClothes(); break;

		case R.id.alleWuensche:
			WishFactory.createAllWishes(); break;

		case R.id.trinkenWunsch:
			WishFactory.createWishToDrink(); break;

		case R.id.einkaufenWunsch:
			WishFactory.createWishToShop(); break;

		case R.id.spuelenWunsch:
			WishFactory.createWishToWashDishes(); break;

		case R.id.medikamentenWunsch:
			WishFactory.createWishToTakeRandomMedicine(); break;
		}

		this.finish();
	}

	@Override
	protected void onDestroy() {
		Model.getInstance().inAppFocus = false;
		super.onDestroy();
	}

	@Override
	protected void onResume() {
		Model.getInstance().inAppFocus = true;
		super.onResume();
	}
}